import request from '@/utils/request'
import md5 from 'md5'
export function getSendCode (parameter) {
  return request({
    url: '/boss/passport/sendCode',
    method: 'post',
    data: parameter
  })
}
export function getReset (parameter) {
  return request({
    url: '/boss/passport/reset',
    method: 'post',
    data: parameter
  })
}
export function login (data) {
  return request({
    url: '/boss/passport/login',
    method: 'post',
    /* eslint-disable */
    data: data.pwd ? {
      ...data,
      pwd: md5(data.pwd)
    } : data,
    headers: {
      token:'d5dd945a88f647a9b9f481c0a296ad2a'
    }
    /* eslint-disable */
  })
}
export function getInfo (parameter) {
  return request({
    url: '/boss/system/user/pmsInfo',
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function getnoTodoNumber (parameter) {
  return request({
    url: '/boss/project/message/noTodoNumber',
    method: 'post',
    data: {},
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function getUnReadNum (parameter) {
  return request({
    url: '/boss/project/message/unReadNumber',
    method: 'post',
    data: {},
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function logout () {
  return request({
    url: '/boss/passport/logout',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function getFeeUserInfo (parameter) {
  return request({
    url: '/boss/admin/info/getUserInfo',
    method: 'get',
    params: parameter
  })
}
export function loginAgain (data) {
  return request({
    url: '/boss/passport/loginAgain',
    method: 'post',
    /* eslint-disable */
    data: data.pwd ? {
      ...data,
      pwd: md5(data.pwd)
    } : data
    /* eslint-disable */
  })
}
/*
* 是否首次签署协议
*  */
export function firtSign (data) {
  return request({
    url: '/boss/passport/first',
    method: 'post',
    data
  })
}

/**
 * 密码有效期校验
 * @param params
 * @return {*}
 */
export function apiValidPwdExpiration (params) {
  return request({
    url: '/boss/system/user/pwd/remind',
    method: 'get',
    params
  })
}

// 获取验证码
export function sendCode (data) {
  return request({
    url: '/boss/passport/sendCode',
    method: 'post',
    data
  })
}

export function userRecentlyPro (parameter) {
  return request({
    url: '/boss/project/team/userRecentlyPro',
    method: 'get',
    params: parameter
  })
}

export function infoPm (data) {
  return request({
    url: '/boss/project/info/isPm',
    method: 'post',
    data
  })
}

